#ifndef VOLUMETOOL_H
#define VOLUMETOOL_H

#include <QWidget>

#define MIN_VALUE_HEIGHT 25
#define MAX_VALUE_HEIGHT 205

namespace Ui {
class VolumeTool;
}

class VolumeTool : public QWidget
{
    Q_OBJECT

public:
    explicit VolumeTool(QWidget *parent = nullptr);
    ~VolumeTool();

    void onSilenceBtnClicked();
    void renewMusicVolume();

signals:
    void setSilence(bool);
    void renewVolume(int);

protected:
    virtual void paintEvent(QPaintEvent *event);
    bool eventFilter(QObject* watched, QEvent* event);
private:
    Ui::VolumeTool *ui;

    bool isMuted;   //是否静音
    int volumeRatio;    //音量大小
};

#endif // VOLUMETOOL_H
